/**
 * ResourceServiceImpl.java
 * Created at 2017-07-06
 * Created by Jackie liu
 * Copyright (C) 2014 , All rights reserved.
 */
package com.huabo.service.impl;

import com.huabo.base.BaseServiceImpl;
import com.huabo.dao.inter.ResourceDao;
import com.huabo.model.Resource;
import com.huabo.service.inter.ResourceService;
import com.huabo.sql.separation.DataSourceChange;
import com.huabo.utils.Page;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * ClassName: ResourceServiceImpl
 * </p>
 * <p>
 * Description: 资源管理service实现
 * </p>
 * <p>
 * Author: Jackie liu
 * </p>
 * <p>
 * Date: 2017-07-06
 * </p>
 */
@Service("resourceService")
public class ResourceServiceImpl extends BaseServiceImpl<Resource, Long, ResourceDao> implements ResourceService {

	@Override
	@DataSourceChange(slave = true)
	public Page<Resource> queryPage(Map<String, Object> params) {
		return getDao().queryPage(params);
	}

	@Override
	@DataSourceChange(slave = false)
	public int batchRemove(Long[] ids) {
		return getDao().batchRemove(ids);
	}

	@Override
	@DataSourceChange(slave = false)
	public int modifyState(Long[] ids, int state) {
		return getDao().modifyState(ids, state);
	}

	@DataSourceChange(slave = true)
	@Override
	public Boolean isDuplicateName(Long id, String name) {
		 return getDao().isDuplicateName(id, name);
	}

	@DataSourceChange(slave = true)
	@Override
	public Boolean isDuplicateCode(Long id, String code) {
		return getDao().isDuplicateCode(id, code);
	}

}